<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>姓名：{{userName}}</p>
        <button @click="changeUserName">改名字</button>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                userName: 'lemon' //　数据层Model--viewModel-->视图层View
            },
            methods: {
                changeUserName () {
                    // console.log(this) // this指向vue实例vm
                    this.userName = 'ziJian'
                }
            }
        })
        console.log(vm)

        //Vue： 视图层view   逻辑处理层viewModel  数据层model   
        //MVVM框架

        // es6 对象简化
    </script>
</body>
</html>  